package org.example.controller;

import org.example.util.R;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class UserController {
    
    @RequestMapping("info")
    public R info() {
        return R.ok("资源");
    }

    @PreAuthorize("hasRole('Admin')")
    @RequestMapping("roleinfo")
    public R roleinfo() {
        return R.ok("内部资源");
    }
}
